package com.charlotte.study.gupao.observer.gper;

import java.util.Observable;
import java.util.Observer;

/**
 * 观察者类
 * @author junjie.ding
 * @date 2020/3/24
 */
public class Teacher implements Observer {

    private String name;

    public Teacher(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        Gper gper = (Gper) o;
        Question question = (Question) arg;
        System.out.println("收到信息：" + gper.toString());
        System.out.println("收到信息：" + question.toString());
    }
}
